package com.star.common.oss.properties;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * oss 配置
 *
 * @author zhouhengzhe
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ConfigurationProperties(prefix = "star.oss")
@Component
public class OssProperties {

    /**
     * 阿里云的oss配置
     */
    private AliyunProperties aliyun;

    /**
     * 华为云的oss配置
     */
    private HuaweiCloudProperties huaweicloud;

    /**
     * aws的oss配置
     */
    private AwsProperties aws;

    /**
     * minio的oss配置
     */
    private MinioProperties minio;

    /**
     * 七牛的oss配置
     */
    private QiniuProperties qiniu;

    /**
     * 腾讯云的oss配置
     */
    private TencentProperties tencent;

    /**
     * 本地的oss配置
     */
    private LocalProperties local;

    /**
     * fastfds的oss配置
     */
    private FastFdsProperties fastfds;

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class AliyunProperties {

        /**
         * 阿里云oss的accessKeyId
         */
        private String accessKeyId;

        /**
         * 阿里云oss的accessKeySecret
         */
        private String accessKeySecret;

        /**
         * 阿里云oss的endpoint
         */
        private String endpoint;
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class HuaweiCloudProperties {
        /**
         * 华为云oss的ak
         */
        private String ak;

        /**
         * 华为云oss的sk
         */
        private String sk;

        /**
         * 华为云oss的endPoint
         */
        private String endPoint;
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class AwsProperties {
        /**
         * aws的endPoint
         */
        private String endPoint;

        /**
         * aws的accessKey
         */
        private String accessKey;

        /**
         * aws的secretKey
         */
        private String secretKey;
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class MinioProperties {
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class QiniuProperties {
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class TencentProperties {
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class LocalProperties {
        /**
         * 资源映射路径 前缀
         */
        public String localFilePrefix;

        /**
         * 域名或本机访问地址
         */
        public String domain;

        /**
         * 上传文件存储在本地的根路径
         */
        private String localFilePath;

    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class FastFdsProperties {
    }
}
